// LXH_Data.h: interface for the CLXH_Data class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_LXH_DATA_H__5E6D7170_7722_4855_8AAF_D147464853C5__INCLUDED_)
#define AFX_LXH_DATA_H__5E6D7170_7722_4855_8AAF_D147464853C5__INCLUDED_

void ErrorMsg(char *msg, HWND hwnd = NULL);

class CData
{
	friend class CDataIO;
	friend class CFeature;
public:
	float GetMax(int *nRow = NULL, int *nCol=NULL);
	CData * SelectIndex(int index[], int nLen);
	void CutFirstPart(int nFinalIndex);
	void CutFirstPart(CData &data, int nFinalIndex);
	void CutFinalPart(int nStartIndex);
	void CutFinalPart(CData &data, int nStartIndex);
	void Append(CData &data);
	CData *ConCat(CData &data);

	BOOL Alloc();
	void RemoveAll();

	int GetNRec();// {return nNRec;}

	int nID;
	int nCol;
	int nRow;
	float** fMat;
	CData * pNext;

	CData();
	CData(CData &data);
	CData(int nRow, int nCol);
	virtual ~CData();

	static float ** New_FMatrix(int nRow, int nCol);
	static double ** New_DMatrix(int nRow, int nCol);
	static void Release_FMatrix (float **m, int nRow, int nCol); 
	static void Release_DMatrix (double **m, int nRow, int nCol); 
	
	CData &operator=( CData &data );
protected:
	CData* pLast;
	int   nNRec;
	void  Append(CData *data);
};

#endif // !defined(AFX_LXH_DATA_H__5E6D7170_7722_4855_8AAF_D147464853C5__INCLUDED_)
